package com.medusa.aps.business.modules.modeling.model.output;

import com.medusa.aps.business.modules.modeling.model.input.WorkingProcedureEquipmentDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;

/**
 * 工序返回结果
 *
 * @author miskw
 * @date 2023/9/2
 * @describe 描述
 */
@Data
@Accessors(chain = true)
public class WorkingProcedureVO {
    /**
     * 主键
     */
    @Schema(description = "主键")
    private Integer id;
    /**
     * 工序编码
     */
    @Schema(description = "工序编码")
    private String processCode;
    /**
     * 工序名称
     */
    @Schema(description = "工序名称")
    private String processName;
    @Schema(description = "工序设备")
    private Integer workingProcedureEquipmentCount;
    @Schema(description = "设备编码列表")
    private List<WorkingProcedureEquipmentDTO> workingProcedureEquipments;
    @Schema(description = "备注")
    private String remarks;
    @Schema(description = "创建人")
    private String creator;
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    @SuppressWarnings("unused")
    public Integer getWorkingProcedureEquipmentCount() {
        return Optional.ofNullable(workingProcedureEquipments).orElse(List.of()).size();
    }

}
